package com.wow.wa.ui;

import android.content.Context;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;

import com.wow.wa.uicommon.R;

public class ItemDialog extends BaseDialog {

	private ListView listView;
	private TextView titleView;
	private String titleName;
	private Button bnt;
	private OnItemClickListener onItemClickListener = null;
	private String[] titles;

	public ItemDialog(String titleName, Context context, String[] title,
			Button btn) {
		super(titleName, context, title);

		this.titleName = titleName;
		this.bnt = btn;
		this.titles = title;

		listView = (ListView) this.getView().findViewWithTag("listView");
		titleView = (TextView) this.getView().findViewWithTag("title");

		this.getView().findViewById(R.id.title);
	}

	public ItemDialog(String titleName, Context context, String[] title) {
		super(titleName, context, title);

		this.titleName = titleName;
	
		this.titles = title;

		listView = (ListView) this.getView().findViewWithTag("listView");
		titleView = (TextView) this.getView().findViewWithTag("title");

		this.getView().findViewById(R.id.title);
	}

	public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
		this.onItemClickListener = onItemClickListener;
		listView.setOnItemClickListener(this.onItemClickListener);
	}

	@Override
	public String getTitle() {
		// TODO Auto-generated method stub
		return titleName;
	}

	public ListView getListView() {
		return listView;
	}

	public void setListView(ListView listView) {
		this.listView = listView;
	}

	public TextView getTitleView() {
		return titleView;
	}

	public void setTitleView(TextView titleView) {
		this.titleView = titleView;
	}

	public String getTitleName() {
		return titleName;
	}

	public void setTitleName(String titleName) {
		this.titleName = titleName;
	}

	public Button getBnt() {
		return bnt;
	}

	public void setBnt(Button bnt) {
		this.bnt = bnt;
	}

	public String[] getTitles() {
		return titles;
	}

	public void setTitles(String[] titles) {
		this.titles = titles;
	}

}
